package controls;

import java.util.Observable;
import java.util.Observer;

//import models.UsuarioLink;

import views.PanFunHome;
import views.WinFuncionario;
import views.WinLogin;

public class ControllerFuncionario implements Observer{
	private WinFuncionario windowFuncionario    = new WinFuncionario();
	
	public void main(WinLogin windowLogin){
		windowFuncionario.criaJanela(windowLogin);
		windowFuncionario.setLocation(windowLogin.getLocation());
		windowFuncionario.showWindow();
		windowFuncionario.addObserver(this);
		
		PanFunHome pf_home = new PanFunHome();
		pf_home.criaPanel();
		pf_home.addObserver(this);
		
		windowFuncionario.setContent(pf_home.getPanel());
	}
	
	@Override
	public void update(Observable arg0, Object arg1) {
		String action = new String ((String) arg1);
		if(action.compareTo("CadServico")==0){
			ControllerFunCadastrarServico cadServico = new ControllerFunCadastrarServico();
			cadServico.setPanel(windowFuncionario);
		}
		
		if(action.compareTo("CadCliente")==0){
			
		}
		
		if(action.compareTo("CadVeiculo")==0){
			
		}
		
		if(action.compareTo("FindCliente")==0){
			
		}
		
		if(action.compareTo("ListaServico")==0){
			ControllerFunListarServico listarServ = new ControllerFunListarServico();
			listarServ.setPanel(windowFuncionario);
		}
		
		if(action.compareTo("FindServico")==0){
			ControllerFunBuscarServico cadServico = new ControllerFunBuscarServico();
			cadServico.setPanel(windowFuncionario);
		}
		
		if(action.compareTo("VerAgenda")==0){
			
		}
	}
}